Ext.grid.GridView.prototype.bind = function(d, c){
    this.initData(d, c);
};

Ext.apply(Ext.Element.prototype, {
	getStyles: function(){
		try {
			el = this.dom;
			if (el.currentStyle) {
				return el.currentStyle; // For Internet Explorer
			}
			else 
				if (document.defaultView.getComputedStyle) {
					return document.defaultView.getComputedStyle(el, null); // For the standard
				}
		} 
		catch (e) {
			return {};
		}
	},

	applyCanvasStyle: function(property, value) {
		this.setStyle(property, value);
		if (!isNaN(parseInt(value)) && (value||"").toString().unit() !== "") {
			this.dom.fullScale[property] = value
		}
	},

	setStylesInline: function() {
		this.clean();
		
		if (this.dom.nodeType === 1) {
			var slot, style, styles;
			this.dom.fullScale = {};
			styles = this.getStyles();
			for (slot in styles) {
				style = styles[slot];
				if (!isNaN(parseInt(style)) && (style||"").toString().unit() !== "") {
					try {
						this.dom.style[slot] = style;
						this.dom.fullScale[slot] = style;
					} 
					catch (e) {
						console.warn(e.message, ": ", slot);
					}
				}
			}
			Ext.each(this.dom.childNodes, 
				function(child) {
					Ext.fly(child).setStylesInline();
				});
		}
		return this;
	},

	scaleContent: function(scale) {
		this.clean();
		if (this.dom.nodeType === 1) {
			var slot, style, styles;
			styles = this.dom.fullScale;

			for (slot in styles) {
				style = styles[slot];
				this.dom.style[slot] = (parseFloat(style, 10) * scale) + style.unit();			
			}
			Ext.each(this.dom.childNodes, 
				function(child){
					Ext.fly(child).scaleContent(scale);	
				});
		}
	}
});

Ext.apply(String.prototype, {
	unit: function(){
		return this.slice(this.length - (this.length - String(parseFloat(this)).length));
	}
});

Ext.delve = function(source, selector) {
	Ext.each(selector.split("."),
		function(property){
			source = source[property];
		});
	return source;
};

Ext.ux.resetCursor = function() {
	Ext.fly(document.body).on('mouseup',
		function() {
			document.body.style.cursor = '';
			Ext.fly(document.body).un('mouseup', Ext.ux.resetCursor);
		});
};
